<template>
	<el-drawer title="联系记录详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="关联客户" prop="customerId">{{form.cnName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="回访类型" prop="linkType">{{form.linkTypeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="联系人" prop="linkManId">{{form.linkManName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="联系类型" prop="recordType">
								<el-tag type="success" size="small" v-if="form.recordType==='0'">我方主动联系</el-tag>
								<el-tag type="danger" size="small" v-else-if="form.recordType==='1'">对方主动联系</el-tag>
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="发送资料" prop="sendFile">
								<el-tag type="success" size="small" v-if="form.sendFile==='0'">未发</el-tag>
								<el-tag type="danger" size="small" v-else-if="form.sendFile==='1'">发送</el-tag>
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="下次回访" prop="nextVisit">{{form.nextVisit}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="联系内容" prop="remark">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				recordId:'',
				cnName:"",
				linkManName:'',
				recordType:"0",
				linkTypeName: "1",
				sendFile:"1",
				nextVisit: '',
				remark: '',
				attachId:'',
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form.recordId = data.recordId
			this.form.cnName = data.cnName
			this.form.linkManName = data.linkManName
			this.form.recordType = data.recordType
			this.form.linkTypeName = data.linkTypeName
			this.form.sendFile = data.sendFile
			this.form.nextVisit = data.nextVisit
			this.form.remark = data.remark
			this.form.attachId = data.attachId
		}
	}
}
</script>

<style>
</style>
